package acwing.算法题;

import java.util.Scanner;

/**
 * @author： li
 * @date： 2022-03-13 16:13
 * @version 1.0
 */
public class 组合字符串 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a,b;
        String res="zzzzzzzzzzzzzzzzzzzz";
        a = sc.next();
        b = sc.next();
        
        for(int i=0;i<a.length();i++)
            for(int j=0;j<b.length();j++){
                String anotherString = a.substring(0, i+1).concat(b.substring(0, j+1));
//               System.out.println(anotherString);
                if(res.compareTo(anotherString)>0){
                    res=anotherString;
                }
            }
        System.out.println(res);

    }
}